﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassLibrary.Configuration.Switch
{   [Serializable]
    public class ConfSwitchingTable
    {
        [Serializable]
        public class Record
        {
            [Serializable]
            public class SwitchingPair
            {
             
                public int PortId { get; set; }
                public int VcId { get; set; }

                public override string ToString()
                {
                    var stringBuilder = new StringBuilder();

                    stringBuilder.AppendLine("[PortId]");
                    stringBuilder.AppendLine(PortId.ToString(CultureInfo.InvariantCulture));
                    stringBuilder.AppendLine("[VcId]");
                    stringBuilder.AppendLine(VcId.ToString(CultureInfo.InvariantCulture));

                    return stringBuilder.ToString();
                }
            }

            public SwitchingPair Ingress { get; set; }
            public SwitchingPair Egress { get; set; }
            
            public Record()
            {
                Egress = new SwitchingPair();
                Ingress = new SwitchingPair();
            }

            public override string ToString()
            {
                var stringBuilder = new StringBuilder();

                stringBuilder.AppendLine("[Ingress]");
                stringBuilder.AppendLine(Ingress.ToString());
                stringBuilder.AppendLine("[Egress]");
                stringBuilder.AppendLine(Egress.ToString());

                return stringBuilder.ToString();
            }
        }

        public Record[] Records { get; set; }
    }
}
